/*
 * Copyright (c) 2020, 2023, 3044483124@qq.com All rights reserved.
 *
 */
package cn.itcast;

import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;

/**
 * <p>Project: JavaStudy - File3
 * <p>Powered by jiangbo On 2023-01-03
 * 14:42:16
 * <p>Created by IntelliJ IDEA
 *
 * @author jiangbo [3044483124@qq.com]
 * @version 1.0
 * @since 8/17
 */
public class File3 {
        //读取文件
        public static void main(String[] args) {
        //读取文件的内容，（文件只能是文本文件ascii文件）
        //什么是文本文件？ .txt .css .js .html .jsp .java
            String book =
                    "G:\\anzhuanranjian\\Java program\\JavaStudy\\src\\cn\\itcast\\Sum100.java";
            try (var f = new FileReader(book)) {
                while (f.ready()) {
                    System.out.print((char) f.read());
                }
            } catch (FileNotFoundException e) {
                throw new RuntimeException(e);
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }

    }


